
SocialBlog = function( vars )	{

	Object.extend( obj = $$( '.SocialBlog' ).pop(), SocialBlog.proto );
	
	obj.triggers 	= obj.select( "li.blog-post" );
	obj.wrappers 	= obj.select( "span.blog-content" );
	obj.vars		= vars;
	
	return obj;
}



SocialBlog.proto =	{

	expand		: function() {
	
		this.triggers.each( function( el, i ) {
			el.observe( 'click', this.delegate.bind( this, el, i ));			
		}, this );
	},
	
	delegate	: function( el, i ) {
		
		if( el.hasClassName( 'active' )) {
			this.wrappers[ i ].update( this.vars[ i ].short );
			el.removeClassName( 'active' );
		} else {
			this.wrappers[ i ].update( this.vars[ i ].long );
			el.addClassName( 'active' );
		}
	}
}
